<template>
  <div id="bottom-bar">
    <div class="bar-item info-left">
      <div>
        <i class="icon service"></i>
        <span class="left-text">客服</span>
      </div>
      <div>
        <i class="icon shop"></i>
        <span class="left-text">店铺</span>
      </div>
      <div class="left-common">
        <i class="icon select"></i>
        <span class="left-text">收藏</span>
      </div>
    </div>
    <div class="bar-item info-right">
      <div class="cart" @click="addCart">加入购物车</div>
      <div class="buy">购买</div>
    </div>
  </div>
</template>

<script>
  export default {
   name: "DetailBottomBar",
    methods:{
     addCart(){
       this.$emit('addCart')
     }
    }
  }
</script>

<style scoped>
  #bottom-bar{
    height: 49px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 11;
    background-color: #f2f5f8;
    display: flex;
    text-align: center;
  }
  .bar-item{
    flex: 1;
    display: flex;
  }
  .bar-item>div{
    flex: 1;
  }
  .icon{
    display: block;
    width: 22px;
    height: 22px;
    margin: 5px auto 3px;
    background: url("~assets/img/detail/detail_bottom.png") 0 0/100%;
  }
  .service{
    background-position: 0 -54px;
  }
  .shop{
    background-position: 0 -98px;
  }
  .left-text{
    font-size: 13px;
  }
  .info-right{
    line-height: 49px;
    font-size: 15px;
  }
  .cart{
    background-color: #ff5777;
    color: #333;
  }
  .buy{
    background-color: #50b7c1;
    color: #fff;
  }
</style>